import { myRequest } from '../utils/request.js'
const userId=uni.getStorageSync('userId')
// 创建用户收件地址
export function addresscreateAPI(data) {
	return myRequest({
		url: "/app-api/member/address/create",
		data,
		method: "POST"
	})
}
// 删除用户收件地址
export function addressdeleteAPI(data) {
	return myRequest({
		url: "/app-api/member/address/delete?id="+data.id,
		data:{},
		method: "DELETE"
	})
}
// 获得用户收件地址
export function addressInfoAPI(data) {
	return myRequest({
		url: "/app-api/member/address/get",
		data,
		method: "GET"
	})
}
// 获得默认的用户收件地址
export function addressdefaultlistAPI(data) {
	return myRequest({
		url: "/app-api/member/address/get-default",
		data,
		method: "GET"
	})
}
// 获得 用户收件地址
export function addresslistAPI(data) {
	return myRequest({
		url: "/app-api/member/address/list",
		data,
		method: "GET"
	})
}
// 获得 用户收件地址
export function addressupdateAPI(data) {
	return myRequest({
		url: "/app-api/member/address/update",
		data,
		method: "PUT"
	})
}
  
// 人员详情评价列表
export function staffCommentAPI(data) {
	return myRequest({
		url: "/app-api/member/staff/staffUserDetailsComment",
		data,
		method: "POST"
	})
}
// 评价统计
export function commentCountAPI(data) {
	return myRequest({
		url: "/app-api/member/staff/commentCount",
		data,
		method: "get"
	})
}
// 我的评价列表
export function myCommentAPI(data) {
	return myRequest({
		url: "/app-api/member/mycomment/page",
		data:{
			...data,userId
		},
		method: "POST"
	})
}

// 1创建客户意见/app-api/member/opinion/create\2创建客户商务合作/store/app-api/member/cooperation/create
export function opinioncreateAPI(type,data) {
	let url=type==1?'/app-api/member/opinion/create':'/app-api/member/cooperation/create'
	return myRequest({
		url,
		data:{
			userId,
			...data
		},
		method: "POST"
	})
}
// 1创建客户意见app-api/member/opinion/page\2创建客户商务合作app-api/member/cooperation/page
export function opinionListAPI(type,data) {
	let url=type==1?'/app-api/member/opinion/page':'/app-api/member/cooperation/page'
	return myRequest({
		url,
		data:{
			userId,
			...data
		},
		method: "GET"
	})
}
// 我的优惠劵列表
export function couponListAPI(data) {
	 
	return myRequest({
		url:"/app-api/member/coupon/page",
		data ,
		method: "GET"
	})
}

// 收藏列表
export function collectionListAPI(n,data) {
	const list=[
		'/app-api/member/userCollection/page',//员工 
		'/app-api/member/merchantCollection/page',//商户 
		'/app-api/member/categoryCollection/page',//获得客户关注分类分页
	]
	return myRequest({
		url:list[n],
		data:{
			userId,
			...data
		},
		method: "POST"
	})
}
// 人员详情
export function userInfoAPI(type,data) {
	 
	return myRequest({
		url:"/app-api/member/user/get",
		data ,
		method: "GET"
	})
}
// 更新人员详情
export function updateuserInfoAPI(data) {
	return myRequest({
		url:"/app-api/member/user/update",
		data ,
		method: "PUT"
	})
}
// 兑换积分
export function createpointAPI( data) {
	return myRequest({
		url: '/app-api/member/app-point/create',
		data:{
			userId,
			...data
		},
		method: "POST"
	})
}
// 兑换积分
export function pointListAPI( data) {
	return myRequest({
		url: '/app-api/member/app-point/page',
		data:{
			userId,
			...data
		},
		method: "GET"
	})
}
// 获得用户积分记录分页
export function recordListAPI(data) {
	return myRequest({
		url: '/app-api/member/point/record/page',
		data:{
			userId,
			...data
		},
		method: "GET"
	})
}
// 获得用户积分记录分页
export function walletListAPI(data) {
	return myRequest({
		url: '/app-api/pay/wallet-recharge-package/list',
		data ,
		method: "GET"
	})
}
// 创建钱包充值记录（发起充值）
export function createrechargeAPI( data) {
	return myRequest({
		url: '/app-api/pay/wallet-recharge/create',
		data ,
		method: "POST"
	})
}
// 洁净币钱包
export function getwalletAPI( data) {
	return myRequest({
		url: '/app-api/pay/wallet/get',
		data ,
		method: "GET"
	})
}
// 获得钱包流水分页
export function transactionwalletAPI( data) {
	return myRequest({
		url: '/app-api/pay/wallet-transaction/page',
		data ,
		method: "GET"
	})
}
// 获得微信账单记录分页
export function wxbillAPI( data) {
	return myRequest({
		url: '/app-api/member/wxbill/page',
		data ,
		method: "POST"
	})
}
// 获得微信账单记录分页
export function createcommentAPI( data) {
	return myRequest({
		url: '/app-api/member/order/item/create-comment',
		data ,
		method: "POST"
	})
}
// 创建客户订单发票
export function createinvoiceAPI( data) {
	return myRequest({
		url: '/app-api/member/invoice/create',
		data ,
		method: "POST"
	})
}
// 获得客户订单发票
export function getinvoiceAPI( data) {
	return myRequest({
		url: '/app-api/member/invoice/get',
		data ,
		method: "GET"
	})
}

// 聊天记录
export function messagePageAPI( data) {
	return myRequest({
		url: '/app-api/member/user-webSocker/messagePage',
		data ,
		method: "POST"
	})
}
// 发送消息
export function createdMsgAPI( data) {
	return myRequest({
		url: '/app-api/member/user-webSocker/send',
		data ,
		method: "POST"
	})
}
// 当前用户所聊的用户
export function messageListAPI( data) {
	return myRequest({
		url: '/app-api/member/user-webSocker/messageList',
		data ,
		method: "POST"
	})
}
// 当前用户所聊的用户
export function isReadAPI( data) {
	return myRequest({
		url: '/app-api/member/user-webSocker/isRead',
		data ,
		method: "GET"
	})
}
// kf
export function kfserviceListAPI( data) {
	return myRequest({
		url: '/app-api/member/app-service/page',
		data ,
		method: "GET"
	})
}

// 地址获得经纬度
export function getAddressgetAddressjwAPI( data) {
	return myRequest({
		url: '/app-api/member/staff/getAddress',
		data ,
		method: "GET"
	})
}

// 创建转账提现记录-客户端1
export function transfercreateAPI( data) {
	return myRequest({
		url: '/app-api/pay/member-transfer/create',
		data ,
		method: "POST"
	})
}
// 创建转账提现记录-客户端2
export function transfersubmitAPI( data) {
	return myRequest({
		url: '/app-api/pay/app-transfer/submit',
		data ,
		method: "POST"
	})
}
// 微信转账订单详情- 
export function getWeiXinByIdAPI( data) {
	return myRequest({
		url: '/app-api/pay/app-transfer/getWeiXinById',
		data ,
		method: "GET"
	})
}